class Solution(object):
    def countGoodSubstrings(self, s):
        ans = 0
        for i in range(len(s) - 2):
            if len({s[i], s[i + 1], s[i + 2]}) == 3:
                ans += 1
        return ans
